﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>更换教练</title>
    <link rel="stylesheet" href="css/amazeui.css">
    <link href="css/amazeui.datetimepicker.css" rel="stylesheet" />
    <script src="js/vue.js"></script>
    <script src="js/jquery-3.2.1.min.js"></script>
    <script src="js/common.js"></script>
    <script src="http://file.jiaoxin-tech.cn/help/js/upyun.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
    <style>
        * {
            padding: 0;
            border: 0;
            margin: 0;
        }

        .veads1_i1 {
            display: block;
            float: left;
            margin-top: 2%;
            width: 2.5%;
        }

        .veads1_s1 {
            display: block;
            text-align: center;
            font-size: 1.8rem;
        }
    </style>
</head>
<body>
    <div id="page1" v-cloak>
        <header data-am-widget="header" class="am-header am-header-default" style="background-color: #FFFFFF; border-bottom: 1px solid rgb(211, 211, 211); ">
            <div class="am-header-left am-header-nav" onclick="goBack()">
                <a href="javascript:" class="">
                    <img class="am-header-icon-custom" src="images/veas07.png" alt="" />
                </a>
            </div>
            <h4 class="am-header-title" style=" color: black;">更换教练</h4>
            <div class="am-header-right am-header-nav"><a href="/Wap/Index.html" class="am-header-icon am-icon-home" style="color: #A9A9A9; "></a></div>
        </header>
        <div class="am-form" data-am-validator>
            <fieldset>
                <div class="am-form-group">
                    <label for="doc-ta-1">更换理由</label>
                    <textarea class="" rows="5" id="doc-ta-1" v-model="profile" placeholder="请输入您的更换原因"></textarea>
                </div>
                <div class="am-form-group">
                    <div v-on:click="choseThisFunc()" class="infom">
                        <div class="choseThis" data-index="index" style="max-width: 25px;height: 25px;max-height:25px;">
                            <img v-if="choseThis==0" src="images/discount_01.png" alt="" style="width: 100%;border-radius: 50%">
                            <img v-else src="images/discount_02.png" alt="" style="width: 100%;border-radius: 50%">
                        </div>
                        <span>是否愿意升级教练</span>
                    </div>
                </div>
            </fieldset>
        </div>
        <button type="button" class="am-btn am-btn-default am-radius" style="width: 90%;display: block;margin: 0 auto;background: #23c788;color: #fff;border-radius: 5px" v-on:click="tijiao()">提交</button>
    </div>
</body>
<script src="js/zishiying.js"></script>
<script src="js/amazeui.datetimepicker.min.js"></script>
<script src="js/amazeui.datetimepicker.zh-CN.js"></script>
<script>
    var page = new Vue({
        el: '#page1',
        venueid:"",
        data: {
            choseThis: 0,
            profile:"",
        },
        methods: {
            //getvenueinfo: function () {
            //    var that = this;
            //    $.ajax({
            //        type: 'GET',
            //        url: apiUrl + '/Api/Mine/GetVenueList',
            //        success: function (data) {
            //            //console.log(data);
            //            if (data.errcode == 0) {
            //                that.venueinfo = data.data.venueList;
            //                that.indexId = data.data.venueList[0].Id;
            //                that.classtype = data.data.ClassType;
            //                that.classtypeId = data.data.ClassType[0].Id;
            //                console.log(that.indexId);
            //            } else {
            //                alert(data.errmsg);
            //            }
            //        },

            //    })
            //},

            tijiao: function () {
                var that = this;
                alert(that.choseThis);
                //alert(window.apiUrl);
                if (that.profile == "")
                { alert("请填写理由"); }
                else{
                    $.ajax({
                        type: 'POST',
                        url: window.apiUrl + '/Api/Field/PrivateUpdataCoach',
                        data: {  gId:that.venueid, profile:that.profile, choseThis:that.choseThis },
                        success: function (data) {
                            if (data.errcode == 0) {
                                alert(data.errmsg, function () {
                                    location.href = "PrivateUserlist.html";
                                });
                                //console.log(that.userinfo)
                            } else {
                                alert(data.errmsg);
                            }
                        },

                    })
                }
            },
            choseThisFunc: function () {
                this.choseThis = !this.choseThis;
            },
        }
    })
    $(function () {
        var actid = $.getParam("gId");
        page.venueid = actid;
        //page.getvenueinfo();
    })

</script>


</html>
